package edu.spec.wyn.week08.book.unit3;

import java.util.Arrays;
public class Student_information {
    int sNO;
    String sName;
    String sSex;
    int sAge;
    double sJava;
    public Student_information(int sNO,String sName,String sSex,int sAge,double sJava) {
        this.sNO=sNO;
        this.sName=sName;
        this.sSex=sSex;
        this.sAge=sAge;
        this.sJava=sJava;
    }
    public int getNo() {
        return sNO;
    }
    public String getName() {
        return sName;
    }
    public String getSex() {
        return sSex;
    }
    public int getAge() {
        return sAge;
    }
    public double getJava() {
        return sJava;
    }
    public void print() {

        System.out.println("学号:"+sNO+"   "+"姓名:"+sName+"      "+"性别:"+sSex+"     "+"年龄"+sAge+"   "+"java成绩："+"   "+sJava);
    }
    public static void main(String[] args) {
        Student_information student1=new Student_information(1701,"张三","男",19,89);
        Student_information student2=new Student_information(1703,"李四","男",20,60);
        Student_information student3=new Student_information(1710,"小明","女",19,78);
        Student_information student4=new Student_information(1704,"小喵","女",18,90);
        Student_information student5=new Student_information(1702,"小汪","男",19,89);

        double avg=(student1.sJava+student2.sJava+student3.sJava+student4.sJava+student5.sJava)/5;

        double a[]= {student1.sJava,student2.sJava,student3.sJava,student4.sJava,student5.sJava};
        Arrays.sort(a);

        Student_information[] Student=new Student_information[5];
        Student[0]=student1;
        Student[1]=student2;
        Student[2]=student3;
        Student[3]=student4;
        Student[4]=student5;

        System.out.println("五个学生的基本信息如下：");
        for(int i=0;i<Student.length;i++) {
            Student[i].print();
        }
        System.out.println("java的平均成绩是："+avg);
        System.out.println("Java最高分是："+a[4]);
        System.out.println("Java成绩的最低分是："+a[0]);
    }
}
